package com.xnengine.bondobongo.screens;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.NinePatch;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Button;
import com.badlogic.gdx.scenes.scene2d.ui.ClickListener;
import com.badlogic.gdx.scenes.scene2d.ui.FlickScrollPane;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle;
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.tablelayout.Table;
import com.xnengine.bondobongo.ConstantUtil;
import com.xnengine.bondobongo.ResourcesManager;
import com.xnengine.bondobongo.customui.FlickScroll;
import com.xnengine.bondobongo.windows.BaseWindow;

public class SelectScreen extends BaseScreen {
	private Table container;
	Skin skin;
	FlickScroll scroll;

	public SelectScreen() {
		super();
		skin = new Skin(Gdx.files.internal("data/uiskin.json"), Gdx.files.internal("data/uiskin.png"));
		setBackGround(new BackGround(ConstantUtil.screenWidth, ConstantUtil.screenHeight, true, Color.BLACK));
	}

	@Override
	public void show() {
		super.show();
		BaseWindow bw = new BaseWindow("win", stage.width(), stage.height());
		stage.addActor(bw);
		/*
		 * Gdx.graphics.setVSync(false);
		 * 
		 * container = new Table(); //container.getTableLayout().debug();
		 * container.setBackground(new
		 * NinePatch(ResourcesManager.getTextureRegion
		 * (ResourcesManager.GAME_STAGE, "window"), 40, 40, 100, 80));
		 * container.width = stage.width(); container.height = stage.height();
		 * 
		 * // container.x=stage.width()/2; // container.y=stage.height()/2;
		 * stage.addActor(container); TextButton leftBtn = new
		 * TextButton("Left", skin); leftBtn.width(50);
		 * leftBtn.setClickListener(new ClickListener() {
		 * 
		 * @Override public void click(Actor actor, float x, float y) {
		 * scroll.FlingScrollX(138); } }); container.add(leftBtn);
		 * 
		 * Table table = new Table(); //table.getTableLayout().debug(); scroll =
		 * new FlickScroll(table); container.add(scroll).width(128); //
		 * scroll.setScrollingDisabled(false, true); //
		 * scroll.setVelocityY(0.01f); table.parse("pad:0 * space:10"); for (int
		 * i = 1; i < 4; i++) {
		 * 
		 * table.add( new Image(new Texture(Gdx.files.internal("data/image" + i
		 * + ".png")))).expandX().fillX();
		 * 
		 * }
		 * 
		 * // container.getTableLayout().row(); Button btn = new
		 * TextButton("Right", skin); btn.width(50); btn.setClickListener(new
		 * ClickListener() {
		 * 
		 * @Override public void click(Actor actor, float x, float y) {
		 * scroll.FlingScrollX(-138); // scroll.setScrollY(800); } });
		 * container.add(btn);
		 * 
		 * Image title=new Image(new
		 * Texture(Gdx.files.internal("data/titleimg.png")));
		 * title.x=stage.width()/2-title.width/2;
		 * title.y=stage.height()-title.height; stage.addActor(title);
		 */
	}
}
